package com.bml.architect.controller;

import com.bml.architect.entity.R;
import com.bml.architect.service.OrderService;
import com.bml.architect.vo.OrderVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/order/")
@Api(value = "订单", tags = "/order/", description = "管理员操作")
public class OrderController {


    @Autowired
    private OrderService orderService;

    @PostMapping
    @ApiOperation(value = "创建订单", httpMethod = "POST", notes = "创建订单")
    @ApiImplicitParam(name = "order", value = "订单实体", dataType = "OrderVo")
    public R saveOrder(@RequestBody OrderVo orderVo) {
        orderService.saveOrder(orderVo);
        return R.ok("success");
    }


}
